<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title></title>
<link rel="stylesheet" href="${resourceUrl}/jacoco-resources/report.css" type="text/css"/>
<link rel="shortcut icon" href="${resourceUrl}/jacoco-resources/report.gif" type="image/gif"/>
<link rel="stylesheet" href="${resourceUrl}/jacoco-resources/prettify.css" type="text/css"/>
<link rel="stylesheet" href="${resourceUrl}/css/maven-base.css" type="text/css"/>
<link rel="stylesheet" href="${resourceUrl}/css/maven-theme.css" type="text/css"/>
<link rel="stylesheet" href="${resourceUrl}/css/site.css" type="text/css"/>
<link rel="stylesheet" href="${resourceUrl}/css/common.css" type="text/css"/>
<script type="text/javascript" src="${resourceUrl}/jacoco-resources/prettify.js"></script>
<script src="${resourceUrl}/js/echarts.js"></script>
<link href="${resourceUrl}/images/plus.gif" type="img/gif"/>
</head>
<body style="padding: 0;margin:0;">
<div class="start">
<span class="gap">
<span style="color:#666;font-family: kaiti;font-size:15px;font-weight: bold;">学号：</span>
<span style="margin: 1%;color:#666;font-family: Apple LiGothic Medium;font-weight: bold;letter-spacing: 10px;">${studentNo}</span>
</span>
<span class="gap">
<span style="color:#666;font-family: kaiti;font-size:15px;font-weight: bold;">姓名：</span>
<span style="margin: 1%;color:#666;font-family: Apple LiGothic Medium;font-weight: bold;letter-spacing: 10px;">${studentName}</span>
</span>
<span class="gap">
<span style="color:#666;font-family: kaiti;font-size:13px;font-weight: bold;">报告生成时间：</span>
<span style="margin:1%;color:#666;font-family: kaiti;font-size:13px;font-weight: bold;">${reportTime}</span>
</span>
</div>
<div class="frame">
<div class="nav">
<a href="#nav1" target='_self' onclick="changeNav(this)" class="active">
<div>总成绩清单</div>
</a>
<a href="#nav2" target='_self' onclick="changeNav(this)">
<div>静态检查详情</div>
</a>
<a href="#nav3" target='_self' onclick="changeNav(this)">
<div>代码通过率详情</div>
</a>
<a href="#nav4" target='_self' onclick="changeNav(this)">
<div>代码覆盖率详情</div>
</a>
</div>
<div style="width:97%;overflow: hidden;height:670px;" id="menu_right">
<div id="nav1" style="height:670px;width:100%;display: flex;align-items:center;flex-direction: column;overflow:hidden;">
<div style="width:30%;margin:10% auto 2% auto; font-size:80px;text-align: center;color:#449D44;">
${totalScore}分
</div>
<div style="width:100%;display: flex;justify-content: space-around;box-sizing:border-box;padding:0 10%;">
<div style="width:25%;height:100px; text-align: center;justify-content: center;box-sizing: border-box;">
<div style="float: left;display: flex;width:100px;height:100px;background-color: #eee;align-items: center;justify-content:center;">
<img src="${resourceUrl}/images/source_attach_attrib.png"style="height:50px;width:50px;padding: 5px;border-radius:30px;background-color: #fff;"/>
</div>
<div style="display:flex;box-sizing: border-box;border:3px solid #eee;height:100px;width:50%;justify-content: center;align-items:center;flex-direction: column;">
<div style="color:rgb(56, 161, 242);font-size:30px;">${checkStyleScore}</div>
<div style="font-size: 14px;">静态检查</div>
</div>
</div>
<div style="width:25%;height:100px; text-align: center;justify-content: center;box-sizing: border-box;">
<div style="float: left;display: flex;width:100px;height:100px;background-color: #eee;align-items: center;justify-content:center;">
<img src="${resourceUrl}/images/testfile_obj.gif"style="height:50px;width:50px;padding: 5px;border-radius: 30px;background-color: #fff;"/>
</div>
<div style="display:flex;box-sizing: border-box;border:3px solid #eee;height:100px;width:50%;justify-content: center;align-items:center;flex-direction: column;">
<div style="color:rgb(56, 161, 242);font-size:30px;">${junitScore}</div>
<div style="font-size: 14px;">通过率</div>
</div>
</div>
<div style="width:25%;height:100px; text-align: center;justify-content: center;box-sizing: border-box;">
<div style="float: left;display: flex;width:100px;height:100px;background-color: #eee;align-items: center;justify-content:center;">
<img src="${resourceUrl}/images/tsuiteok.png"style="width:50px;height:50px;border-radius: 30px;padding: 5px;background-color: #fff;"/>
</div>
<div style="display:flex;box-sizing: border-box;border:3px solid #eee;height:100px;width:50%;justify-content: center;align-items:center;flex-direction: column;">
<div style="color:rgb(56, 161, 242);font-size:30px;">${covScore}</div>
<div style="font-size: 14px;">覆盖率</div>
</div>
</div>
</div>
</div>
<#--check style 处理-->
<div id="nav2" style="height:670px;">
<div id="checkStyle_content" style="height:670px;width:100%;overflow: auto;">${checkStyle}</div>
</div>
<#--JUnit 处理-->
<div id="nav3" style="height:670px;">
<#macro JUnitMacro node>
<li>
<div style="white-space: nowrap;">
<#if node.children?? && node.children?size gt 0>
<span class="treenode" class="icon" onclick="parentClick(this)" isOpen="false">
<img src="${resourceUrl}/images/expand_less_24px_1181833_easyicon.net .png"/>
</span>
</#if>
<span class="icon">
<#if node.children?? && node.children?size gt 0>
<span class="icon">
<img src="${resourceUrl}/jacoco-resources/package.gif"/>
</span>
<#else>
<span class="icon"><img src="${resourceUrl}/jacoco-resources/class.gif"/></span>
</#if>
</span>
<span style="overflow: auto;">
<span><a href="#JUNIT_${node.name}" target='_self'>${node.label}</a></span>
<#assign a=node.nodeData.runTestCase b=node.nodeData.failuresTestCase+node.nodeData.errorsTestCase>
<span style="font-size:0;white-space:nowrap;">
<img src="${resourceUrl}/jacoco-resources/greenbar.gif" width="${(a-b)/a*100}" height="10"/>
<img src="${resourceUrl}/jacoco-resources/redbar.gif" width="${b/a*100}" height="10"/>
</span>
</span>
</div>
<#assign children=node.children>
<ul isOpen="false" style="display: none;">
<#if children?? && children?size gt 0>
<#list children as t> <#--list循环-->
<@JUnitMacro node = t/> <#--内部递归调⽤用-->
</#list>
</#if>
</ul>
</li>
</#macro>
<div class="left" style="height:100%;">
<ul style="padding-left: 20px;">
<@JUnitMacro node = junitRoot/><#--外部调用-->
</ul>
</div>
<div class="right" style="height:100%;">
<#list junitDataList as junitData>
<div id='JUNIT_${junitData.nodeName}' style='height:100%;'>
<div style="height:100%;width:50%;float:left;border-right:1px solid #eee;">
<div style="margin-top:20%;">
<div style="text-align: center;font-size:20px;letter-spacing: 5px;margin-bottom:5%;">${node.nodeName}</div>
<div class="table">
<div class="tr-1">
<div class="td">测试用例总数</div>
<div class="td">成功用例总数</div>
<div class="td">失败用例总数</div>
<div class="td">错误用例总数</div>
<div class="td">跳过用例总数</div>
</div>
<div class="tr-2">
<div class="td">${junitData.runTestCase}</div>
<div class="td">${junitData.successTestCase}</div>
<div class="td">${junitData.failuresTestCase}</div>
<div class="td">${junitData.errorsTestCase}</div>
<div class="td">${junitData.skippedTestCase}</div>
</div>
</div>
</div>
<#if junitData.message??>
<div style="margin-top:5%;margin-left: 10%;font-weight: bold;font-size:12px;">详情
</div>
<div style="margin-top:5%;">
<div style="overflow: auto;max-height:300px;width:80%;margin:0 auto;word-break:break-all;">
${junitData.message}
</div>
</div>
</#if>
</div>
<div style="height:100%;width:49%;display:flex;" id="${junitData.nodeName}JunitChart"></div>
</div>
</#list>
</div>
</div>
<#--JUnitChart 处理-->
<#list junitDataList as nodeData>
<script>
var junitChart = echarts.init(document.getElementById('${nodeData.nodeName}JunitChart'));
// 指定图表的配置项和数据
option = {
title: {
text: '测试用例统计',
left: 'center'
},
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b} : {c} ({d}%)'
},
legend: {
orient: 'vertical',
left: 'left',
data: ["通过的用例数量", "失败的用例数量", "错误的用例数量", "跳过的用例数量"]
},
series: [
{
name: '访问来源',
type: 'pie',
radius: '55%',
center: ['50%', '60%'],
data: [
{value: ${nodeData.successTestCase}, name: '通过的用例数量'},
{value: ${nodeData.failuresTestCase}, name: '失败的用例数量'},
{value: ${nodeData.errorsTestCase}, name: '错误的用例数量'},
{value: ${nodeData.skippedTestCase}, name: '跳过的用例数量'}
],
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
};
junitChart.setOption(option);
</script>
</#list>
<#-- coverage 处理理-->
<div id="nav4" style="height:670px;">
<#macro CovMacro node>
<li>
<div style="white-space: nowrap;">
<span class="treenode" class="icon" onclick="parentClick(this)" isOpen="false">
<img src="${resourceUrl}/images/expand_less_24px_1181833_easyicon.net .png"/>
</span>
<#assign a=node.nodeData.branchRate b=1 - a>
<#if node.children?? && node.children?size gt 0>
<span class="icon"> <img src="${resourceUrl}/jacoco-resources/package.gif"/> </span>
<span><a href="#COV_${node.name}" target='_self'>${node.label}</a></span>
<span style="font-size:0;white-space:nowrap">
<img src="${resourceUrl}/jacoco-resources/greenbar.gif" width="${a*100}" height="10"/>
<img src="${resourceUrl}/jacoco-resources/redbar.gif" width="${b*100}" height="10"/>
</span>
<#else>
<span class="icon"><img src="${resourceUrl}/jacoco-resources/class.gif"/></span>
<span><a href="#COV_${node.name}" target='_self'>${node.label}</a></span>
<span style="font-size:0;white-space:nowrap">
<img src="${resourceUrl}/jacoco-resources/greenbar.gif" width="${a*100}" height="10"/>
<img src="${resourceUrl}/jacoco-resources/redbar.gif" width="${b*100}" height="10"/>
</span>
<ul isOpen="false" style="display: none;">
<span class="treenode" class="icon" onclick="parentClick(this)" isOpen="false">
<img src="${resourceUrl}/images/expand_less_24px_1181833_easyicon.net%20.png"/>
</span>
<span class="icon"><img src="${resourceUrl}/jacoco-resources/class.gif"/></span>
<span><a href="#COVCODE_${node.name}" target='_self'>源代码</a></span>
</ul>
</#if>
</div>
<ul isOpen="false" style="display: none;">
<#if node.children?? && node.children?size gt 0 >
<#list node.children as child>
<@CovMacro node=child />
</#list>
</#if>
</ul>
</li>
</#macro>
<div class="left" style="height:100%;">
<ul style="padding-left: 20px;">
<@CovMacro node = covRoot/>
</ul>
</div>
<div class="right" style="height:100%;">
<#list covDataList as nodeData>
<div style="height:100%;width:100%;display:flex;"
id="COV_${nodeData.nodeName}">
<div style="width:50%;margin-top:20%;overflow-x:auto;">
<div style="font-size:20px;text-align: center;letter-spacing: 30px;">覆盖率数据</div>
<div class="table">
<div class="tr-1">
<div class="td">包/类名</div>
<div class="td">未覆盖行数</div>
<div class="td">覆盖总行数</div>
<div class="td">行覆盖率</div>
<div class="td">未覆盖分支数</div>
<div class="td">覆盖分支数</div>
<div class="td">分支覆盖率</div>
<div class="td">未覆盖方法数</div>
<div class="td">覆盖方法数</div>
<div class="td">方法覆盖率</div>
</div>
<div class="tr-2">
<div class="td">${projectName}</div>
<div class="td">${nodeData.lineMissed}</div>
<div class="td">${nodeData.lineCovered}</div>
<div class="td">${nodeData.lineRate}</div>
<div class="td">${nodeData.branchMissed}</div>
<div class="td">${nodeData.branchCovered}</div>
<div class="td">${nodeData.branchRate} </div>
<div class="td">${nodeData.methodMissed}</div>
<div class="td">${nodeData.methodCovered}</div>
<div class="td"> ${nodeData.methodRate}</div>
</div>
<#list nodeData.node.children as child>
<#if (nodeData.node.children?size-child_index-1)==2>
<div class="tr-1">
<#else>
<div class="tr-2">
</#if>
<#assign childData = child.nodeData/>
<div class="td">${child.label}</div>
<div class="td">${childData.lineMissed}</div>
<div class="td">${childData.lineCovered}</div>
<div class="td"> ${childData.lineRate}</div>
<div class="td">${childData.branchMissed}</div>
<div class="td">${childData.branchCovered}</div>
<div class="td"> ${childData.branchRate}</div>
<div class="td">${childData.methodMissed}</div>
<div class="td">${childData.methodCovered}</div>
<div class="td">${childData.methodRate}</div>
</div>
</#list>
</div>
</div>
<div style="height:100%;width:49%;display:flex;" id="${nodeData.nodeName}CovChart">
</div>
</div>
<#--coverage Chart 处理-->
<script>
var covChart = echarts.init(document.getElementById('${nodeData.nodeName}CovChart'));
<#assign covNode = nodeData.node/>
option = {
legend: {},
tooltip: {},
dataset: {
dimensions: ["coverage",'行覆盖率', '分支覆盖率', '方法覆盖率'],
source: [
{coverage: '${covNode.label}', '行覆盖率': ${nodeData.instructionRate}, '分支覆盖率': ${nodeData.branchRate},
'方法覆盖率': ${nodeData.methodRate}},
<#list covNode.children as child>
<#assign childData = child.nodeData/>
{coverage: '${child.label}', '行覆盖率': ${child.nodeData.instructionRate}, '分支覆盖率': ${child.nodeData.branchRate}, '方法覆盖率': ${child.nodeData.methodRate}},
</#list>
]
},
xAxis: {type: 'category'},
yAxis: {},
series: [
{type: 'bar'},
{type: 'bar'},
{type: 'bar'}
]
};
covChart.setOption(option);
</script>
</#list>
<!--覆盖率文件处理-->
<#list covFileList as nodeFile>
<div id='COVCODE_${nodeFile.name}' style="height:100%;overflow: auto;" class="breadcrumb" onload="window['PR_TAB_WIDTH']=4;prettyPrint()">
<h1>${nodeFile.head}.java</h1>
${nodeFile.javaCode}
</div>
</#list>
</div>
</div>
</div>
</div>
<script>
window.onload = () => {
resize();
}
window.addEventListener('resize',resize);
function resize(){
let element;
let start = document.querySelector('.start');
console.log(start.style.height);
var h = window.innerHeight - 51>600?window.innerHeight-51:600;
let menu_right = document.querySelector('#menu_right');
let nav1 = document.querySelector('#nav1');
let nav2 = document.querySelector('#nav2');
let nav3 = document.querySelector('#nav3');
let nav4 = document.querySelector('#nav4');
let checkStyle_content = document.getElementById('checkStyle_content');
// let left = document.querySelector('.left');
// let right = document.querySelector('.right');
// let cov_content = document.getElementById("cov_content");
// let code_cov_left = document.querySelector("#cov_content .left");
// let code_cov_right = document.querySelector("#cov_content .right");
element = document.querySelector('#JUNIT_projectName');
if (element) {
element.style.height = h + 'px';
}
element = document.querySelector('#JUNIT_test');
if (element) {
element.style.height = h + 'px';
}
element = document.querySelector('#JUNIT_test_DayTest');
if (element) {
element.style.height = h + 'px';
}
element = document.querySelector('#JUNIT_test_MonthTest');
if (element) {
element.style.height = h + 'px';
}
element = document.querySelector('#JUNIT_test_NextdayTest');
if (element) {
element.style.height = h + 'px';
}
element = document.querySelector('#JUNIT_test_TestExam1');
if (element) {
element.style.height = h + 'px';
}
element = document.querySelector('#JUNIT_test_YearTest');
if (element) {
element.style.height = h + 'px';
}
let nav = document.querySelector('.nav');
menu_right.style.height = h + 'px';
nav1.style.height = h + 'px';
nav2.style.height = h + 'px';
nav3.style.height = h + 'px';
nav4.style.height = h + 'px';
checkStyle_content.style.height = h + 'px';
// left.style.height = h + 'px';
// right.style.height = h + 'px';
//
// cov_content.style.height = h + 'px';
// code_cov_left.style.height = h + 'px';
// code_cov_right.style.height = h + 'px';
nav.style.height = h + 'px';
}
</script>
<script type="text/javascript" src="${resourceUrl}/js/tree.js"></script>
</body>
</html>